import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/projectResource/createBatch',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/projectResource/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/projectResource',
    method: 'put',
    data
  })
}
// 查询项目人力资源池
export function getProjectResource(params) {
  return request({
    url: 'api/projectResource',
    method: 'get',
    params
  })
}

// 取得专业数据
export function getDiscipline(params) {
  return request({
    url: 'api/projectResource/discipline',
    method: 'get',
    params
  })
}

// 取得角色数据
export function getProjectRole(params) {
  return request({
    url: 'api/projectResource/role',
    method: 'get',
    params
  })
}

// 取得候选公司数据
export function getProjDeptOption(params) {
  return request({
    url: 'api/projectResource/projDeptOption',
    method: 'get',
    params
  })
}

// 查询人力资源池的候选成员
export function projMemberOption(params) {
  return request({
    url: 'api/projectResource/projMemberOption',
    method: 'get',
    params
  })
}
// 查询人力资源池的候选成员
export function findDeptUsers(data) {
  return request({
    url: 'api/users/findDeptUsers',
    method: 'POST',
    data
  })
}

// 查询人力资源池角色和专业是否可编辑
export function queryNoDelProjResRoleAndDisc(params) {
  return request({
    url: 'api/projectResource/queryNoDelProjResRoleAndDisc',
    method: 'get',
    params
  })
}

export default { add, edit, del, getDiscipline, getProjectRole, getProjectResource, getProjDeptOption, projMemberOption, queryNoDelProjResRoleAndDisc }

